package com.yihu.wlyy.repository;

import com.yihu.wlyy.entity.WlyyJobConfig;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Administrator on 2016/8/17.
 */
public interface WlyyJobConfigDao extends PagingAndSortingRepository<WlyyJobConfig, String>, JpaSpecificationExecutor<WlyyJobConfig> {

    @Query(" FROM WlyyJobConfig a WHERE a.id=?1 and a.status=?2 and a.del='1'")
    WlyyJobConfig findById(String code, String status);

    @Query(" FROM WlyyJobConfig a WHERE a.status=?1 and a.del='1'")
    List<WlyyJobConfig> findByAll(String s);

    @Query(" FROM WlyyJobConfig a WHERE a.id in (1,2,3,4,5,6,7,8,9,10)  and a.del='1' ")
    List<WlyyJobConfig> findByIds();

    @Query(" FROM WlyyJobConfig a WHERE a.id=?1 and a.del='1'")
    WlyyJobConfig findById(String id);
}
